﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 电子票存档工具
{
    public partial class FProgressBar : Form
    {
        public int RunCount { get; set; } = 0;

        public bool needClose { get; set; } = false;

        public FProgressBar(string runInfo, int minimum)
        {
            InitializeComponent();
            labelRunInfo.Text = runInfo;
            progressBarRun.Maximum = minimum;
            labelRunInfo.BackColor = Color.FromArgb(0, labelRunInfo.BackColor); // 设置50%的透明度
            labelRunInfo.FlatStyle = FlatStyle.System;
            labelRunInfo.UseMnemonic = false;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (RunCount<=progressBarRun.Maximum)
                progressBarRun.Value= RunCount;
            if (needClose)
                Close();
        }
    }
}
